package com.hmall.common.domain;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

@Data
@NoArgsConstructor
@AllArgsConstructor(staticName = "of")
public class DelayMessage<T> {
    private T coreMsgData;
    private List<Integer> delayTime;

    public Integer nextDalayTime() {
        return delayTime.remove(0);
    }

    public boolean havaNextDalyaTime() {
        return !delayTime.isEmpty();
    }
}
